package org.karai.frame.ui.home;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.viewbinding.ViewBinding;

import org.karai.frame.R;
import org.karai.frame.core.base.FrameFragment;
import org.karai.frame.core.base.IBasePresenter;
import org.karai.frame.databinding.FragmentHomeBinding;
import org.karai.frame.model.ITestModel;
import org.karai.frame.presenter.ITestPresenter;
import org.karai.frame.view.ITestView;

public class HomeFragment extends FrameFragment<FragmentHomeBinding , ITestPresenter> implements ITestView {



    @Override
    public void onDestroyView() {
        super.onDestroyView();
        binding = null;
    }

    @Override
    public ITestPresenter setPersenter() {
        return new ITestPresenter(new ITestModel() , this , requireActivity());
    }

    @Override
    public ViewBinding setLayOut(LayoutInflater inflater, ViewGroup container) {
        return FragmentHomeBinding.inflate(getLayoutInflater() ,container , false);
    }


    @Override
    public void showDoThingsResult(String result) {
        binding.textHome.setText(result);
    }

    @Override
    public void startEvent() {
      this.persenter.doThings(this.binding.textHome);
    }
}